import API from "./api";
import {Get, Post} from "./http";

export const apiGetMenus = async () => {
  const result = await Get("/api" + API.getMenus);
  console.log("1", result)
  return result;
}

export const getData2 = async () => {
  const result = await Get("http://172.81.207.92/data/data1/2.json");
  console.log("1", result)
  return result;
}

export const getBanner = async () => {
  const {data, err} = await Get(`${API.bannerList}?application=unt`);
  if (err) return;
  return data;
}

export const getCatList = async () => {
  const {data, err} = await Get(API.catList);
  if (err) return;
  return data;
}

export const getHomePageList = async (code) => {
  const {data, err} = await Post(API.homePageList, {catCode: code, pageInfo: {pageNo: 1, pageSize: 20}});
  if (err) return;
  return data;
}
